package com.itheima.clientAndService01;

public class SystemClass {
    public static void main(String[] args) {
        //method1();
        //method2();
        int[] arr1 = {1, 2, 3, 4, 5, 6, 7, 8, 9};
        int[] arr2 = new int[arr1.length];
        //被拷贝集合，起始位置，拷贝进的集合，起始位置，拷贝长度
        System.arraycopy(arr1, 0, arr2, 0, 2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
    }

    private static void method2() {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            System.out.println(i);
        }
        long end = System.currentTimeMillis();
        System.out.println("看看程序跑了多少毫秒：" + (end - start) + "毫秒");
    }

    private static void method1() {
        System.out.println("我要结束程序！");
        //结束程序，0是正常结束，其它数字表示程序非正常结束
        System.exit(0);
        System.out.println("程序结束了吗？");
    }
}
